package cn.itcast.cloud.controller;

import cn.itcast.cloud.pojo.User;
import cn.itcast.cloud.service.UserServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserServices userService;

    @GetMapping()
    public void queryById(@RequestParam("ids") List<Long> ids) {
        List<User> users = this.userService.queryUserByIds(ids);
        users.forEach(user -> System.out.println(user));
    }
}